import request from '@/utils/request.js'

// 获取部门列表
export const getDeparments = () => request({
  url: '/company/department',
  method: 'GET'
})

// 新增部门
// axios,params是在url传数据
//       data是在请求体传数据
export const addDepartments = (data) => request({
  url: '/company/department',
  method: 'POST',
  data
})

// 删除部门
export const delDepartments = (id) => request({
  url: '/company/department/' + id,
  method: 'DELETE'
})

// 更新部门
export const getDepartmentById = (id) => request({
  url: '/company/department/' + id,
  method: 'GET'
})

// 编辑部门
export const updateDepartment = (data) => request({
  url: '/company/department/' + data.id,
  method: 'PUT',
  data
})
